<!doctype html>



  


<html class="theme-next muse use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  
    
      
    

    
  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Microsoft YaHei:300,300italic,400,400italic,700,700italic|consolas:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.2" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="HongqinMa, Hiraku, web前端, web全栈, javascript, html, css, nodejs" />








  <link rel="shortcut icon" type="image/x-icon" href="http://ofy7k3v4s.bkt.clouddn.com/mylogo.png?v=5.0.2" />






<meta name="description" content="Spell at all costs， to rush you in the future.">
<meta property="og:type" content="website">
<meta property="og:title" content="HongqinMa' Blog">
<meta property="og:url" content="https://hongqinma.github.io/page/6/index.html">
<meta property="og:site_name" content="HongqinMa' Blog">
<meta property="og:description" content="Spell at all costs， to rush you in the future.">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="HongqinMa' Blog">
<meta name="twitter:description" content="Spell at all costs， to rush you in the future.">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '6347850919329138000',
      author: 'Hiraku'
    }
  };
</script>




  <link rel="canonical" href="https://hongqinma.github.io/page/6/"/>


  <title> HongqinMa' Blog </title>
</head>

<body itemscope itemtype="//schema.org/WebPage" lang="en">

  



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?10010323";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-left 
   page-home 
 ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="//schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta custom-logo">
  
    <div class="site-meta-headline">
      <a>
        <img class="custom-logo-image" src="http://ofy7k3v4s.bkt.clouddn.com/photo.jpg"
             alt="HongqinMa' Blog"/>
      </a>
    </div>
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">HongqinMa' Blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">Spell at all costs， to rush you in the future。</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            About
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            Tags
          </a>
        </li>
      

      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            
  <section id="posts" class="posts-expand">
    
      

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/2014/07/12/14-js-的正则表达式/" itemprop="url">
                  js-的正则表达式
                </a>
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2014-07-12T20:46:39+08:00" content="2014-07-12">
              2014-07-12
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/JavaScript/" itemprop="url" rel="index">
                    <span itemprop="name">JavaScript</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2014/07/12/14-js-的正则表达式/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2014/07/12/14-js-的正则表达式/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
          &#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x662F;&#x4E00;&#x4E2A;&#x63CF;&#x8FF0;&#x5B57;&#x7B26;&#x6A21;&#x5F0F;&#x7684;&#x5BF9;&#x8C61;&#x3002; JavaScript &#x7684; RegExp &#x7C7B;&#x8868;&#x793A;&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#xFF0C;String &#x548C; RegExp &#x90FD;&#x5B9A;&#x4E49;&#x4E86;&#x65B9;&#x6CD5;&#xFF0C;&#x540E;&#x8005;&#x4F7F;&#x7528;&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x8FDB;&#x884C;&#x5F3A;&#x5927;&#x7684;&#x6A21;&#x5F0F;&#x5339;&#x914D;&#x548C;&#x6587;&#x672C;&#x68C0;&#x7D22;&#x4E0E;&#x66FF;&#x6362;&#x529F;&#x80FD;&#x3002;
&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x5B9A;&#x4E49;&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x7684;&#x76F4;&#x63A5;&#x91CF;&#x5B9A;&#x4E49;&#x4E3A;&#x5305;&#x542B;&#x5728;&#x4E00;&#x5BF9;&#x659C;&#x6760; (/) &#x4E4B;&#x95F4;&#x7684;&#x5B57;&#x7B26;
&#x5982;&#xFF1A;
1var pattern = /s$/;
&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x4E2D;&#x7684;&#x57FA;&#x672C;&#x5143;&#x5B57;&#x7B26;
. &#x901A;&#x914D;&#x7B26;&#xFF08;. &#x9664;&#x4E86;\n&
          ...

          <div class="post-more-link text-center">
            <a class="btn" href="/2014/07/12/14-js-的正则表达式/#more" rel="contents">
              Read more &raquo;
            </a>
          </div>
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>

    <footer class="post-footer">
      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/2014/07/03/13-实现继承的几种方式/" itemprop="url">
                  实现继承的几种方式
                </a>
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2014-07-03T20:21:32+08:00" content="2014-07-03">
              2014-07-03
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/JavaScript/" itemprop="url" rel="index">
                    <span itemprop="name">JavaScript</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2014/07/03/13-实现继承的几种方式/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2014/07/03/13-实现继承的几种方式/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
          ECMAScript &#x4E2D;&#x53EA;&#x652F;&#x6301;&#x5B9E;&#x73B0;&#x7EE7;&#x627F;&#xFF0C;&#x800C;&#x4E14;&#x4E3B;&#x8981;&#x4F9D;&#x9760;&#x7684;&#x662F;&#x539F;&#x578B;&#x94FE;&#x6765;&#x5B9E;&#x73B0;&#x3002;
&#x6269;&#x5C55;&#x539F;&#x578B;&#x5BF9;&#x8C61;&#x5B9E;&#x73B0;&#x7EE7;&#x627F;
&#x63CF;&#x8FF0;&#xFF1A;&#x76F4;&#x63A5;&#x5728;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7684;prototype&#x5C5E;&#x6027;&#x4E0A;&#x6DFB;&#x52A0;&#x65B9;&#x6CD5;
&#x89E3;&#x51B3;&#x7684;&#x95EE;&#x9898;&#xFF1A;&#x89E3;&#x51B3;&#x4E86;&#x76F4;&#x63A5;&#x5C06;&#x65B9;&#x6CD5;&#x8BBE;&#x7F6E;&#x5728;&#x6784;&#x9020;&#x51FD;&#x6570;&#x4E0A;&#x65F6;&#xFF0C;&#x5B9E;&#x4F8B;&#x5316;&#x6BCF;&#x4E2A;&#x5BF9;&#x8C61;&#x8FD9;&#x4E9B;&#x65B9;&#x6CD5;&#x90FD;&#x4F1A;&#x5F00;&#x8F9F;&#x65B0;&#x7A7A;&#x95F4;&#xFF0C;&#x9020;&#x6210;&#x5185;&#x5B58;&#x4E25;&#x91CD;&#x6D6A;&#x8D39;&#x7684;&#x95EE;&#x9898;
&#x7F3A;&#x70B9;&#xFF1A;&#x5982;&#x679C;&#x5C06;&#x6240;&#x6709;&#x7684;&#x65B9;&#x6CD5;&#x90FD;&#x76F4;&#x63A5;&#x8BBE;&#x7F6E;
          ...

          <div class="post-more-link text-center">
            <a class="btn" href="/2014/07/03/13-实现继承的几种方式/#more" rel="contents">
              Read more &raquo;
            </a>
          </div>
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>

    <footer class="post-footer">
      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/2014/06/14/12-原型链/" itemprop="url">
                  原型链
                </a>
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2014-06-14T22:30:42+08:00" content="2014-06-14">
              2014-06-14
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/JavaScript/" itemprop="url" rel="index">
                    <span itemprop="name">JavaScript</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2014/06/14/12-原型链/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2014/06/14/12-原型链/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
          &#x539F;&#x578B;&#x5BF9;&#x8C61;&#x539F;&#x578B;&#x5BF9;&#x8C61;&#xFF1A;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7684;prototype&#x5C5E;&#x6027;&#xFF1A;&#x968F;&#x7740;&#x5B9E;&#x4F8B;&#x5316;&#x7684;&#x6B21;&#x6570;&#x589E;&#x52A0;&#xFF0C;&#x4E0D;&#x540C;&#x7684;&#x5BF9;&#x8C61;&#x4ED6;&#x4EEC;&#x62E5;&#x6709;&#x7684;say&#x65B9;&#x6CD5;&#x6307;&#x5411;&#x4E0D;&#x540C;&#x7684;&#x5185;&#x5B58;&#xFF0C;&#x80FD;&#x76F8;&#x540C;&#xFF0C;&#x9020;&#x6210;&#x4E86;&#x5185;&#x5B58;&#x7684;&#x6D6A;&#x8D39;,&#x4E3A;&#x4E86;&#x89E3;&#x51B3;&#x5185;&#x5B58;&#xFF0C;&#x5C06;&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x653E;&#x5728;&#x67D0;&#x4E2A;&#x5BF9;&#x8C61;&#xFF08;&#x539F;&#x578B;&#x5BF9;&#x8C61;&#xFF09;&#x4E2D;.
&#x7ED3;&#x8BBA;1&#xFF1A;&#x7ED9;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7684;prototype&#x5C5E;&#x6027;&#xFF08;&#x5BF9;&#x8C61;&#xFF09;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;&#x65B9;&#x6CD5;&#xFF0C;&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x5C31;&#x53EF;&#x4EE5;&#x88AB;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7684;&#x5B9E;&#x4F8B
          ...

          <div class="post-more-link text-center">
            <a class="btn" href="/2014/06/14/12-原型链/#more" rel="contents">
              Read more &raquo;
            </a>
          </div>
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>

    <footer class="post-footer">
      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/2014/06/03/11-面向对象的程序设计/" itemprop="url">
                  面向对象的程序设计
                </a>
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2014-06-03T23:33:08+08:00" content="2014-06-03">
              2014-06-03
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/JavaScript/" itemprop="url" rel="index">
                    <span itemprop="name">JavaScript</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2014/06/03/11-面向对象的程序设计/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2014/06/03/11-面向对象的程序设计/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
          &#x9762;&#x5411;&#x5BF9;&#x8C61;&#x7684;&#x8BED;&#x8A00;&#x7684;&#x6807;&#x5FD7;&#x5C31;&#x662F;&#x5B83;&#x4EEC;&#x6709;&#x7C7B;&#x7684;&#x6982;&#x5FF5;&#xFF0C;&#x901A;&#x8FC7;&#x7C7B;&#x53EF;&#x4EE5;&#x521B;&#x5EFA;&#x4EFB;&#x610F;&#x591A;&#x4E2A;&#x5177;&#x6709;&#x76F8;&#x540C;&#x5C5E;&#x6027;&#x548C;&#x65B9;&#x6CD5;&#x7684;&#x5BF9;&#x8C61;&#x3002;JavaScript &#x4E2D;&#x7684;&#x7C7B;&#x7684;&#x5B9E;&#x73B0;&#x662F;&#x57FA;&#x4E8E;&#x5176;&#x539F;&#x578B;&#x7EE7;&#x627F;&#x673A;&#x5236;&#x3002;&#x5982;&#x679C;&#x4E24;&#x4E2A;&#x5B9E;&#x4F8B;&#x90FD;&#x4ECE;&#x540C;&#x4E00;&#x4E2A;&#x539F;&#x578B;&#x5BF9;&#x8C61;&#x4E0A;&#x7EE7;&#x627F;&#x4E86;&#x5C5E;&#x6027;&#xFF0C;&#x5C31;&#x8BA4;&#x4E3A;&#x662F;&#x540C;&#x4E00;&#x4E2A;&#x7C7B;&#x7684;&#x5B9E;&#x4F8B;&#x3002;
JavaScript &#x7684;&#x5BF9;&#x8C61;&#x662F;&#x5C5E;&#x6027;&#x540D;&#x4EE5;&#x53CA;&#x4E0E;&#x4E4B;&#x5BF9;&#x5E94;&#x7684;&#x503C;&#x7684;&#x57FA;&#x672C;&#x96C6;&#x5408;&#x3002;&#x96C6;&#x5408;&#x662F;&#x4E00;&#x79CD;&#x6570;&
          ...

          <div class="post-more-link text-center">
            <a class="btn" href="/2014/06/03/11-面向对象的程序设计/#more" rel="contents">
              Read more &raquo;
            </a>
          </div>
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>

    <footer class="post-footer">
      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/2014/05/24/10-js-的函数/" itemprop="url">
                  js 的函数
                </a>
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2014-05-24T23:18:22+08:00" content="2014-05-24">
              2014-05-24
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/JavaScript/" itemprop="url" rel="index">
                    <span itemprop="name">JavaScript</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2014/05/24/10-js-的函数/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2014/05/24/10-js-的函数/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
          js &#x9AD8;&#x7A0B;&#x4E2D;&#x8FD9;&#x6837;&#x5B9A;&#x4E49;&#x51FD;&#x6570;&#xFF1A;&#x51FD;&#x6570;&#x662F;&#x8FD9;&#x6837;&#x4E00;&#x6BB5; JavaScript &#x4EE3;&#x7801;&#xFF0C;&#x53EA;&#x5B9A;&#x4E49;&#x4E00;&#x6B21;&#xFF0C;&#x4F46;&#x53EF;&#x4EE5;&#x88AB;&#x6267;&#x884C;&#x4EFB;&#x610F;&#x591A;&#x6B21;&#x3002;JavaScript &#x7684;&#x51FD;&#x6570;&#x662F;&#x53C2;&#x6570;&#x5316;&#x7684;&#xFF1A;&#x51FD;&#x6570;&#x7684;&#x5B9A;&#x4E49;&#x4F1A;&#x5305;&#x62EC;&#x4E00;&#x4E2A;&#x79F0;&#x4E3A;&#x5F62;&#x53C2;&#x548C;&#x6807;&#x8BC6;&#x7B26;&#x5217;&#x8868;&#xFF0C;&#x8FD9;&#x4E9B;&#x53C2;&#x6570;&#x5728;&#x51FD;&#x6570;&#x4F53;&#x4E2D;&#x5C31;&#x50CF;&#x5C40;&#x90E8;&#x53D8;&#x91CF;&#x4E00;&#x6837;&#x5DE5;&#x4F5C;&#x3002;&#x51FD;&#x6570;&#x7684;&#x8C03;&#x7528;&#x4F1A;&#x4E3A;&#x5F62;&#x53C2;&#x63D0;&#x4F9B;&#x5B9E;&#x53C2;&#x7684;&#x503C;&#x3002;&#x51FD;&#x6570;&#x4F7F;&#x7528;&#x5B83;&#x4EEC;&#x5B9E;&#x53C2;&#x7684;&#x503C;&#x6765;&#x8BA1;&#x7B97;&#x8FD4;&#x56DE;&#x503C;&#xFF0C;&#x6210;&#x4E3
          ...

          <div class="post-more-link text-center">
            <a class="btn" href="/2014/05/24/10-js-的函数/#more" rel="contents">
              Read more &raquo;
            </a>
          </div>
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>

    <footer class="post-footer">
      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/2014/05/15/09-js-String对象/" itemprop="url">
                  js String对象
                </a>
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2014-05-15T22:19:03+08:00" content="2014-05-15">
              2014-05-15
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/JavaScript/" itemprop="url" rel="index">
                    <span itemprop="name">JavaScript</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2014/05/15/09-js-String对象/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2014/05/15/09-js-String对象/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
          String &#x7C7B;&#x578B;String &#x7C7B;&#x578B;&#x662F;&#x5B57;&#x7B26;&#x4E32;&#x7684;&#x5BF9;&#x8C61;&#x5305;&#x88C5;&#x7C7B;&#x578B;&#x3002;&#x521B;&#x5EFA;&#x65B9;&#x5F0F;&#x6709;&#x4E24;&#x79CD;&#xFF1A;

var strObject = new String(&#x201C;abc&#x201D;);
var strValue = &#x201C;abc&#x201D;;

&#x5176;&#x4E2D;&#xFF0C;&#x7EE7;&#x627F;&#x7684; valueOf()&#xFF0C;toLocaleString()&#xFF0C;toString() &#x65B9;&#x6CD5;&#xFF0C;&#x90FD;&#x8FD4;&#x56DE;&#x5BF9;&#x8C61;&#x6240;&#x8868;&#x793A;&#x7684;&#x57FA;&#x672C;&#x5B57;&#x7B26;&#x4E32;&#x503C;&#x3002;
String &#x7C7B;&#x578B;&#x7684;&#x5B9E;&#x4F8B;&#x90FD;&#x6709;&#x4E00;&#x4E2A; length &#x5C5E;&#x6027;&#xFF0C;&#x8868;&#x793A;&#x5305;&#x542B;&#x591A;&#x5C11;&#x4E2A;&#x5B57;&#x7B26;&#xFF0C;&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x83B7;&#x53D6;&#x5B57;&#x7B26;&#x4E32;&#x7684;&#x957F;&#x5EA6;&#x3002;

&#x5B57;&#x7B26;&#x65B9;&#x6CD5;:charAt() &#x548C; charCodeAt()
charAt(&#x4E0B;&#x6807;);&#x83B7;&#x53D6;&#x8BE5;&#x4E0B;&#x6807;&#x4F4D;&#x7F6E;&#x7684;&#
          ...

          <div class="post-more-link text-center">
            <a class="btn" href="/2014/05/15/09-js-String对象/#more" rel="contents">
              Read more &raquo;
            </a>
          </div>
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>

    <footer class="post-footer">
      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/2014/05/11/08-js-的数组/" itemprop="url">
                  js 的数组
                </a>
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2014-05-11T20:52:03+08:00" content="2014-05-11">
              2014-05-11
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/JavaScript/" itemprop="url" rel="index">
                    <span itemprop="name">JavaScript</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2014/05/11/08-js-的数组/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2014/05/11/08-js-的数组/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
          &#x6570;&#x7EC4;&#x662F;&#x8868;&#x793A;&#x96C6;&#x5408;&#x7684;&#x503C;&#xFF0C;&#x6BCF;&#x4E00;&#x4E2A;&#x503C;&#x662F;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#xFF0C;&#x6BCF;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x5728;&#x6570;&#x7EC4;&#x4E2D;&#x6709;&#x4E00;&#x4E2A;&#x4F4D;&#x7F6E;&#xFF0C;&#x4EE5;&#x6570;&#x5B57;&#x8868;&#x793A;&#xFF0C;&#x53EB;&#x7D22;&#x5F15;&#x3002;&#x6570;&#x7EC4;&#x7EE7;&#x627F;&#x81EA; Array.prototype.
js &#x7684;&#x5185;&#x7F6E;&#x5BF9;&#x8C61;: &#x6570;&#x7EC4;Array&#x6570;&#x7EC4;&#x58F0;&#x660E;
&#x76F4;&#x63A5;&#x91CF;&#x65B9;&#x5F0F;&#x521B;&#x5EFA;&#x6570;&#x7EC4;

1234var empty = []; // &#x6CA1;&#x6709;&#x5143;&#x7D20;&#x7684;&#x7A7A;&#x6570;&#x7EC4;var num = [1,3,2,4,5]; // &#x6709;5&#x4E2A;&#x5143;&#x7D20;&#x7684;&#x6570;&#x7EC4;var misc = [1, true, &quot;a&quot;, ]; // &#x6709;&#x4E0D;&#x540C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x5143;&#x7D20;&#x7684;&#x6570;&#x7EC4;var misc2 = [[1], {x: 1, y: 2},[2, {x:2, y: 1}]];
&#x6570;&#x7EC4;&#x76F4;&#x63A5;&#x91CF;&#x4E2D;&#x
          ...

          <div class="post-more-link text-center">
            <a class="btn" href="/2014/05/11/08-js-的数组/#more" rel="contents">
              Read more &raquo;
            </a>
          </div>
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>

    <footer class="post-footer">
      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/2014/05/02/07-js-的对象/" itemprop="url">
                  js 的对象
                </a>
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2014-05-02T20:14:53+08:00" content="2014-05-02">
              2014-05-02
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/JavaScript/" itemprop="url" rel="index">
                    <span itemprop="name">JavaScript</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2014/05/02/07-js-的对象/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2014/05/02/07-js-的对象/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
          &#x9664;&#x4E86;&#x5B57;&#x7B26;&#x4E32;&#x3001;&#x6570;&#x5B57;&#x3001;true&#x3001;false&#x3001;null &#x548C; undefined &#x4E4B;&#x5916;&#xFF0C;JavaScript &#x4E2D;&#x7684;&#x503C;&#x90FD;&#x662F;&#x5BF9;&#x8C61;&#x3002;&#x5F15;&#x7528;&#x7C7B;&#x578B;&#x7684;&#x503C;&#xFF08;&#x5BF9;&#x8C61;&#xFF09;&#x662F;&#x5F15;&#x7528;&#x7C7B;&#x578B;&#x7684;&#x4E00;&#x4E2A;&#x5B9E;&#x4F8B;&#x3002;&#x5728; ECMAScript &#x4E2D;&#xFF0C;&#x5F15;&#x7528;&#x7C7B;&#x578B;&#x662F;&#x4E00;&#x79CD;&#x6570;&#x636E;&#x7ED3;&#x6784;&#xFF0C;&#x7528;&#x4E8E;&#x5C06;&#x6570;&#x636E;&#x548C;&#x529F;&#x80FD;&#x7EC4;&#x7EC7;&#x5728;&#x4E00;&#x8D77;&#x3002;
&#x4ECE;&#x5B8F;&#x89C2;&#x7684;&#x89D2;&#x5EA6;&#x8BB2;&#xFF0C;&#x5BF9;&#x8C61;&#x662F;&#x5BF9;&#x5BA2;&#x89C2;&#x4E8B;&#x7269;&#x7684;&#x62BD;&#x8C61;&#xFF0C;&#x4E8B;&#x7269;&#x7684;&#x7279;&#x5F81;&#x53EF;&#x4EE5;&#x7528;&#x5C5E;&#x6027;&#x8868;&#x793A;&#xFF0C;&#x4E8B;&#x7269;&#x7684;&#x884C;&#x4E3A;&#x53EF;&#x4EE5;&#x7528;&#x65B9;&#x6CD5;&#x8868;&#x793A;&#xFF1B
          ...

          <div class="post-more-link text-center">
            <a class="btn" href="/2014/05/02/07-js-的对象/#more" rel="contents">
              Read more &raquo;
            </a>
          </div>
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>

    <footer class="post-footer">
      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/2014/04/06/05-js-语句/" itemprop="url">
                  js语句
                </a>
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2014-04-06T22:29:25+08:00" content="2014-04-06">
              2014-04-06
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/JavaScript/" itemprop="url" rel="index">
                    <span itemprop="name">JavaScript</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2014/04/06/05-js-语句/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2014/04/06/05-js-语句/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
          ECMAScript &#x8BED;&#x6CD5;&#x5B9A;&#x4E49;&#x7684;&#x8BED;&#x53E5;&#x901A;&#x5E38;&#x4F7F;&#x7528;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x5173;&#x952E;&#x5B57;&#x6765;&#x5B8C;&#x6210;&#x7ED9;&#x5B9A;&#x7684;&#x4EFB;&#x52A1;&#x3002;
&#x6761;&#x4EF6;&#x5224;&#x65AD;&#x7ED3;&#x6784; if/ if&#x2026;else/ if&#x2026;else &#x5D4C;&#x5957;12345if(&#x6761;&#x4EF6;&#x8868;&#x8FBE;&#x5F0F;){  // &#x5982;&#x679C;&#x6761;&#x4EF6;&#x8868;&#x8FBE;&#x5F0F;&#x4E3A;true&#xFF0C;&#x6267;&#x884C;&#x8BE5;&#x5904;&#x4EE3;&#x7801;}else{  // &#x5982;&#x679C;&#x6761;&#x4EF6;&#x8868;&#x8FBE;&#x5F0F;&#x4E3A;false,&#x6267;&#x884C;&#x8BE5;&#x5904;&#x4EE3;&#x7801;}
&#x6761;&#x4EF6;&#x5224;&#x65AD;&#x7684;&#x5D4C;&#x5957;
123456789if(&#x6761;&#x4EF6;&#x8868;&#x8FBE;&#x5F0F;&#xFF09;{  //&#x5982;&#x679C;&#x6761;&#x4EF6;&#x8868;&#x8FBE;&#x5F0F;&#x7ED3;&#x679C;&#x4E3A;true,&#x6267;&#x884C;&#x8BE5;&#x8BED;&#x53E5;&#xFF0C;&#x4E0B;&#x8FB9;&#x8BED;&#x53E5;&#x4E0D;&#x6267;&#x884C;&#x3002;}else if(&#x6761;&#x4EF6;&#x8868;&#
          ...

          <div class="post-more-link text-center">
            <a class="btn" href="/2014/04/06/05-js-语句/#more" rel="contents">
              Read more &raquo;
            </a>
          </div>
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>

    <footer class="post-footer">
      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
      

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                
                <a class="post-title-link" href="/2014/04/06/06-js-Date、Math、包装对象、RegExp/" itemprop="url">
                  js Date、Math、包装对象、RegExp
                </a>
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2014-04-06T18:23:22+08:00" content="2014-04-06">
              2014-04-06
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/JavaScript/" itemprop="url" rel="index">
                    <span itemprop="name">JavaScript</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2014/04/06/06-js-Date、Math、包装对象、RegExp/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2014/04/06/06-js-Date、Math、包装对象、RegExp/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
          javaScript&#x7684;&#x51E0;&#x4E2A;&#x5185;&#x7F6E;&#x5BF9;&#x8C61;Date&#x5BF9;&#x8C61;ECMAScript 5 &#x63D0;&#x4F9B;&#x4E86;&#x4E24;&#x4E2A;&#x65B9;&#x6CD5;&#xFF1A;Date.parase() &#x548C; Date.UTC() &#x8FD4;&#x56DE;&#x65E5;&#x671F;&#x7684;&#x6BEB;&#x79D2;&#x6570;
123456789var now = new Date();   //&#x521B;&#x5EFA;&#x5BF9;&#x8C61;alert(Date()); //&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x5B8C;&#x6574;&#x7684;&#x65E5;&#x671F;&#x65F6;&#x95F4;alert(now.getDate()); //&#x8FD4;&#x56DE;&#x4ECE;1&#x5F00;&#x59CB;&#x8BA1;&#x6570;&#x7684;&#x5929;&#x6570;alert(now.getDay()); //&#x8FD4;&#x56DE;&#x5F53;&#x524D;&#x5468;&#x51E0;alert(now.getFullYear()); //&#x8FD4;&#x56DE;&#x5F53;&#x524D;&#x5E74;&#x4EFD;alert(now.getMonth()+1);  //&#x8FD4;&#x56DE;&#x5F53;&#x524D;&#x6708;&#x4EFD;alert(now.getHours());  //&#x5F53;&#x5730;&#x65F6;&#x95F4;&#x7684;&#x5C0F;&#x65F6;var then = new Date(2011, 10, 10);  // 2011&#x5E74;10&#x6708;10&#x65E5;
&#x65E5;&#x671F;&#x683C;&#x5F0F;&#x5316;&#x65B9;&#x6CD5;
toDateString();
toTimeStrin
          ...

          <div class="post-more-link text-center">
            <a class="btn" href="/2014/04/06/06-js-Date、Math、包装对象、RegExp/#more" rel="contents">
              Read more &raquo;
            </a>
          </div>
        
      
    </div>

    <div>
      
    </div>

    <div>
      
    </div>

    <footer class="post-footer">
      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </article>


    
  </section>

  
  <nav class="pagination">
    <a class="extend prev" rel="prev" href="/page/5/"><i class="fa fa-angle-left"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/5/">5</a><span class="page-number current">6</span><a class="page-number" href="/page/7/">7</a><a class="extend next" rel="next" href="/page/7/"><i class="fa fa-angle-right"></i></a>
  </nav>



          </div>
          


          

        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      

      <section class="site-overview sidebar-panel  sidebar-panel-active ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="//schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/photo.jpg"
               alt="Hongqin Ma" />
          <p class="site-author-name" itemprop="name">Hongqin Ma</p>
          <p class="site-description motion-element" itemprop="description">Spell at all costs， to rush you in the future. </p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">68</span>
              <span class="site-state-item-name">posts</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">16</span>
                <span class="site-state-item-name">categories</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">57</span>
                <span class="site-state-item-name">tags</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/HongqinMa" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/HongqinMa" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://www.facebook.com/profile.php?id=100006581058735" target="_blank" title="Facebook">
                  
                    <i class="fa fa-fw fa-facebook"></i>
                  
                  Facebook
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.zhihu.com/people/HirakuMa" target="_blank" title="知乎">
                  
                    <i class="fa fa-fw fa-share-alt"></i>
                  
                  知乎
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              Links
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/rubylouvre/" title="司徒正美" target="_blank">司徒正美</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/sanshi/" title="三生石上" target="_blank">三生石上</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/TomXu/" title="汤姆大叔" target="_blank">汤姆大叔</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://gold.xitu.io/" title="掘金" target="_blank">掘金</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://segmentfault.com/" title="segmentfault" target="_blank">segmentfault</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.jianshu.com/users/1cbb94e5ed4d/latest_articles" title="简书" target="_blank">简书</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://home.cnblogs.com/" title="博客园" target="_blank">博客园</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://www.awesomes.cn/" title="Awesomes" target="_blank">Awesomes</a>
                </li>
              
            </ul>
          </div>
        

      </section>

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2016</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Hongqin Ma</span>
</div>

<div class="powered-by">
  Powered by <a class="theme-link" href="https://hexo.io">Hexo</a>
</div>

<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>

<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span id="busuanzi_container_site_pv">
    &nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;Page Views: <span id="busuanzi_value_site_pv"></span> 
</span>

        

<div class="busuanzi-count">

  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv"><i class="fa fa-user"></i><span class="busuanzi-value" id="busuanzi_value_site_uv"></span></span>
  

  
    <span class="site-pv"><i class="fa fa-eye"></i><span class="busuanzi-value" id="busuanzi_value_site_pv"></span></span>
  
  
</div>



        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.2"></script>



  
  

  

  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.2"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"Hiraku"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  






  
  

  

  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
  <script>AV.initialize("PPmoIQxeu8Sd21h6Tl9TthNx-gzGzoHsz", "rTvbY2H7DvWzRipiBwn72RQ4");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  

  
  
  <!-- custom analytics part create by xiamo -->
<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
<script>AV.initialize("PPmoIQxeu8Sd21h6Tl9TthNx-gzGzoHsz", "rTvbY2H7DvWzRipiBwn72RQ4");</script>
<script>
function showTime(Counter) {
  var query = new AV.Query(Counter);
  $(".leancloud_visitors").each(function() {
    var url = $(this).attr("id").trim();
    query.equalTo("url", url);
    query.find({
      success: function(results) {
        if (results.length == 0) {
          var content = '0 ' + $(document.getElementById(url)).text();
          $(document.getElementById(url)).text(content);
          return;
        }
        for (var i = 0; i < results.length; i++) {
          var object = results[i];
          var content = object.get('time') + ' ' + $(document.getElementById(url)).text();
          $(document.getElementById(url)).text(content);
        }
      },
      error: function(object, error) {
        console.log("Error: " + error.code + " " + error.message);
      }
    });

  });
}

function addCount(Counter) {
  var Counter = AV.Object.extend("Counter");
  url = $(".leancloud_visitors").attr('id').trim();
  title = $(".leancloud_visitors").attr('data-flag-title').trim();
  var query = new AV.Query(Counter);
  query.equalTo("url", url);
  query.find({
    success: function(results) {
      if (results.length > 0) {
        var counter = results[0];
        counter.fetchWhenSave(true);
        counter.increment("time");
        counter.save(null, {
          success: function(counter) {
            var content =  counter.get('time') + ' ' + $(document.getElementById(url)).text();
            $(document.getElementById(url)).text(content);
          },
          error: function(counter, error) {
            console.log('Failed to save Visitor num, with error message: ' + error.message);
          }
        });
      } else {
        var newcounter = new Counter();
        newcounter.set("title", title);
        newcounter.set("url", url);
        newcounter.set("time", 1);
        newcounter.save(null, {
          success: function(newcounter) {
              console.log("newcounter.get('time')="+newcounter.get('time'));
            var content = newcounter.get('time') + ' ' + $(document.getElementById(url)).text();
            $(document.getElementById(url)).text(content);
          },
          error: function(newcounter, error) {
            console.log('Failed to create');
          }
        });
      }
    },
    error: function(error) {
      console.log('Error:' + error.code + " " + error.message);
    }
  });
}
$(function() {
  var Counter = AV.Object.extend("Counter");
  if ($('.leancloud_visitors').length == 1) {
    addCount(Counter);
  } else if ($('.post-title-link').length > 1) {
    showTime(Counter);
  }
}); 
</script>

  
</body>
</html>
